home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
107_01
/
ctrig.doc
< prev
next >
Wrap
Text File
|
1984-06-03
|
2KB
|
102 lines
NOTES ON TRIG FUNCTIONS FOR BDS - C
Introduction
These trig functions were developed so that I could do some auxiliary work
on scaling and curve generation for a graphics package I'm now doing in BDS-C.
They seem to work OK in my setup which is now:
o Altair 8800b, 64K CPM 2.2 BDS-C vers 1.42
o Tarbell SSSD 4 8 inch disk
o Scion Microangelo
o LSI ADM3A
This package was developed by:
L. C. Calhoun PE
257 South Broadway
Lebanon, Ohio 45036
<513> 932-4541/433-7510
REVISION 1 13 JULY 1981
The CTRIG programs have been revised to take advantage of the ability to
insert '\0' into string constants which make it possible to use string constant
as pseudo-static floating point constants. In addition, the values of the
constants have been revised to improve performance. An added arctangent
function arctan2() has been added to allow quadrant detection for arctangents.
The test software "TESTTRIG" has been improved in format, and tests added for
arctan2().
These programs are written in BDS-C using the floating point package
modified to add truncation and magnitude functions. This package is called
"FLOAT+44". The following functions are mechanized:
1
char *sine(result,angle)
char *result, *angle; /* usual [5] char arrays for fp */
The angle input argument is in radians, within the bounds of the
floating point variable. The function returns the pointer to the
result.
char *cosine(result,angle)
char *result, *angle; /* as with sine */
Identical to the sine
char *tangent(result,angle)
char *result, *angle; /*as with sine */
char *arctan(angle,datum)
char *angle, *datum;
This returns the angle in radians. Error conditions, such as too
small or large a datum return "end value" angles.